<%-- 
    Document   : index
    Created on : 03-may-2012, 19:35:12
    Author     : Administrador
--%>

<%@page import="java.util.Date"%>
<%@page import="WS.awslaboratorio"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>JSP Page</title>
</head>
<body>
	<%
		long i = new Date().getTime();
	            WS.awslaboratorio w = new WS.awslaboratorio();
	            String NL = "\r";
	            //RESUTADO?
	            /*		
	            String hl7 = "MSH|^~\\&|SA|SV|RA|RF|20120319172439||ORU^R01|MSG-S-762|P|2.5|||"+NL+
	            		"PID|1||41545265^^^SA^ExternalPatientID~null^^^SA^NTS~null^^^SA^SSN||ALONSO&CABRERA^LUCIA&^||19800202|F|||^^^^^|||||"+NL+
	            		"PV1||A|^^||||||||||||||||1"+NL+
	            		"ORC|SC||71412.144.7^Modulab||||||201109011523||||||201109301020||||||152"+NL+            		
	            		"OBR|1||71412.144.7^MODULAB|UR^Urea^MODULAB||||||||||||0^Doctor pruebas SonLlatzer||||||||LAB|F|||||||alfons^20080602185137+0200"+NL+
	            		"OBX|1|NM|WBC^Leucocitos^MODULAB||534.00|10*3/mm3|3.5 - 10.8|HH|||F|||20080529214430"+NL+
	            		"OBX|2|NM|HEM^Hematies^MODULAB||787.00|10*3/mm3|3.8 - 6.1|HH|||F|||20080529214430"+NL+
	            		"OBX|3|NM|HGB^Hemoglobina^MODULAB||312.0|10*3/mm3|12.0 - 17.0|HH|||F|||20080529214430"+NL+
	            		"OBX|4|NM|HTO^Hematocrito^MODULAB||312.0|10*3/mm3|37.0 - 51.0|HH|||F|||20080529214430"+NL+
	            		"OBX|5|NM|VCM^ Volumen Corpuscular Medio^MODULAB||312.0|10*3/mm3|80.0 - 99.0|HH|||F|||20080529214430";
	           */
	           
	           String hl7 = "MSH|^~\\&|SA|SV|RA|RF|20120319172439||ORU^R01|MSG-S-762|P|2.5|||"+NL+
	        		   "PID|1||41545265^^^SA^ExternalPatientID~null^^^SA^NTS~null^^^SA^SSN||ALONSO&CABRERA^LUCIA&^||19800202|F|||^^^^^|||||"+NL+
	        		   "PV1||A|^^||||||||||||||||138"+NL+
	        		   "ORC|SC||71412.144.7^Modulab||||||201109011523||||||201109301020||||||152"+NL+
	        		   "OBR|1||71412.144.7^MODULAB|UR^Urea^MODULAB||||||||||||0^Doctor pruebas SonLlatzer||||||||LAB|F|||||||alfons^20080602185137+0200"+NL+
	        		   "OBX|1|NM|WBC^Leucocitos^MODULAB||534.00|10*3/mm3|3.5 - 10.8|HH|||F|||20080529214430"+NL+
	        		   "OBX|2|NM|HEM^Hematies^MODULAB||787.00|10*3/mm3|3.8 - 6.1|HH|||F|||20080529214430"+NL+
	        		   "OBX|3|NM|HGB^Hemoglobina^MODULAB||312.0|10*3/mm3|12.0 - 17.0|HH|||F|||20080529214430"+NL+
	        		   "OBX|4|NM|HTO^Hematocrito^MODULAB||312.0|10*3/mm3|37.0 - 51.0|HH|||F|||20080529214430"+NL+
	        		   "OBX|5|NM|VCM^ Volumen Corpuscular Medio^MODULAB||312.0|10*3/mm3|80.0 - 99.0|HH|||F|||20080529214430";
	            //NUEVA ORDEN
	           
	            String hl7orden = "MSH|^~\\&|GEOSALUD_CAMEC|CAMEC|LAB|LAB|20110912140000||OML^021|138|P|2.5|||"+NL+
	              "PID|||18936831^^^2.16.840.1.113883.2.14.1.2.1.2||LOPEZ&PEREZ^JOSE&JUAN||19731006|M||||||||"+NL+
	              "PV1||A|SECTOR&SUBSECTOR^PISO^LUGAR^^^PRESTADOR^SUCURSAL||15;1734;2;1||2.16.840.1.113883.2.14.1.2.1.3^4575^HOUSE^GREGORY|"+NL+ 
	              "ORC|NW|32;1256;5|||||||20060922155300||||||||||||034"+NL+
	              "OBR|1|32;1256;5||24361-8^HEMOGRAMA^2.16.840.1.113883.6.1||20060922155300";

	 int a = hl7.split("\\|").length;
	%>
	<h1>
			<%out.print("RESULTADO: "+w.execute(hl7));%>
			<%//out.print("RESULTADO: "+w.execute(hl7));%>
	</h1>
	<h1>
		<%out.print(a);%>
	</h1>
</body>
</html>
